<% if tasks and tasks.size > 0 %>
<div id="other_states_<%=id%>">
<%

[['Inbox','inbox'],
['Next Action','next'],
['Waiting','waiting'],
['Sometime/Maybe','maybe'],
['Reference','ref']].each { |s|
    
  nb = tasks.select{ |t| t.state==s[1]}.size
  if nb > 0
%>
<div class="state <%= s[1] %>"><%= s[1] %> : <b><%= nb %></b></div>
<%  
  end
  }
%>

<%= link_to_remote('Show them', :url => { :action=>"show_other_states", :id=>id }, :update=>"other_states_#{id}") %>
</div>
<% end %>
